﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using System.Data;
using System.Data.SqlClient;

namespace DAO
{
   public  class daoNhapKho
    {

       public static DataTable LoadNhapKho()
       {
           return DataProvider.SpSelect("usp_XemNhapKho");
       }
       public static int AddNhapKho(dtoNhapKho nhapkho)
       {
          
           var parameters = new List<SqlParameter>
                                 {
                                     new SqlParameter("@NgayNhap ", nhapkho.NgayNhap){SqlDbType = SqlDbType.SmallDateTime},
                                     new SqlParameter("@TongTien", nhapkho.TongTien){SqlDbType = SqlDbType.Float},
                                                                              };
           var output = new SqlParameter("@Ma_NhapKho", SqlDbType.Int) { Direction = ParameterDirection.Output };
           return (int)DataProvider.spInsert_Update_Test("usp_ThemNhapKho", parameters, output);

       }

    }
}
